
import { aPost } from '@/library/http.js'
export function getData(date) {
  return new Promise((resolve, reject) => {
    aPost({
      url: '/api/calendar/day',
      data: {
        date
      },
      success(data) {
        resolve(data)
      },
      error(err) {
        reject(err)
      }
    })
  })
}
export function getMonthData(month) {
  return new Promise((resolve, reject) => {
    aPost({
      url: '/api/calendar/month',
      data: {
        'year-month': month
      },
      success(data) {
        resolve(data)
      },
      error(err) {
        reject(err)
      }
    })
  })
}
export function getYearData(year) {
  return new Promise((resolve, reject) => {
    aPost({
      url: '/api/calendar/year',
      data: {
        year
      },
      success(data) {
        resolve(data)
      },
      error(err) {
        reject(err)
      }
    })
  })
}
